package com.youi.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.youi.shop.pojo.entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 订单表 Mapper 接口
 * </p>
 *
 * @author xxf
 * @since 2020-11-09
 */
@Mapper
@Repository
public interface OrderMapper extends BaseMapper<Order> {

    /**
     * 插入订单
     * @param order
     * @return
     */
    void insertOrder(@Param("order") Order order);

    /**
     * 根据会员id查询订单
     * @param memberId
     * @return
     */
    List<Order> selectByMemberId(@Param("memberId") Long memberId);

    /**
     * 根据订单id查询订单
     * @param orderId
     * @return
     */
    Order selectByOrderId(@Param("orderId") Long orderId);
}
